#define _CRT_SECURE_NO_WARNINGS  1
#pragma warning(disable:6031)
#include <stdio.h>

int main()
{
    char string[1001] = { 0 };
    int k = 0;
    scanf("%s", string);
    scanf("%d", &k);
    string[k] = '\0';
    printf("%s", string);
    return 0;
}